package com.kefu.call.vo;

import javax.validation.constraints.Size;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractInsertVo;
import com.kefu.call.model.ActivityBaseInfo;
import cn.hutool.core.util.IdUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author francis
 * @date 2021/05/22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "活动管理")
public class ActivityBaseInfoInsertVo extends AbstractInsertVo<ActivityBaseInfo> {

    @ApiModelProperty(value = "数据状态0 无效，1有效",hidden=true)
    private Integer dataStatus=1;

    @ApiModelProperty(value = "活动名称")
    private String activityName;

    @ApiModelProperty(value = "活动描述")
    private String activityDesp;

    @ApiModelProperty(value = "活动类型",example="1",allowableValues="1",notes="1 外呼活动")
    private Integer activityType = 1;

    @ApiModelProperty(value = "活动状态",example="1",allowableValues="0,1,2,3",notes="0 未启用，1启用，2暂停，3 停止")
    private Integer activityStatus = 1;

    @ApiModelProperty(value = "活动开始时间")
    private Long activityStartTime;

    @ApiModelProperty(value = "活动结束时间")
    private Long activityEndTime;

    @ApiModelProperty(value = "是否隐藏号码",allowableValues="0,1",notes="0 不隐藏号码，1隐藏号码")
    private Integer hiddenNum;

    @ApiModelProperty(value = "是否开启问卷调查",allowableValues="0,1",notes="0 不开启，1 开启")
    private Integer paperOpen = 0;

    @ApiModelProperty(value = "问卷ID",notes="关联问卷ID")
    private String paperId;
    
    @ApiModelProperty(value = "坐席助手ID",notes="关联坐席助手ID")
    private String helperId;

    @Override
    public ActivityBaseInfo convert() {
        ActivityBaseInfo info = new ActivityBaseInfo();
	    info.setDataStatus(dataStatus);
	    info.setActivityName(activityName);
	    info.setActivityDesp(activityDesp);
	    info.setActivityType(activityType);
	    info.setActivityStatus(activityStatus);
	    info.setActivityStartTime(activityStartTime);
	    info.setActivityEndTime(activityEndTime);
	    info.setHiddenNum(hiddenNum);
	    info.setPaperOpen(paperOpen);
	    info.setPaperId(paperId);
	    info.setHelperId(helperId);
        KefuContext context = KefuContext.getKefuContext();
		info.setActivityId(IdUtil.simpleUUID());
	    info.setCreateTime(context.getNow());
	    info.setCreateUser(context.getUserId());
	    info.setUpdateTime(context.getNow());
	    info.setUpdateUser(context.getUserId());
	    info.setTenantId(context.getTenantId());
	    return info;
	}
}